import React,{Component} from 'react'
import '../css/category1.css'
import cate_shop from '../data/category'
import { Pagination } from 'antd';
export default class Category1 extends Component{
    constructor(props){
        super(props)
        this.state={
            list:'',
            current: 1,
        }
    }
    onChange = page => {
        console.log(cate_shop)
        this.setState({
          current: page,
        });
      };
      tap(){
          this.props.history.push('/newsDetail')
      }
    render(){
        
        return(
            <div>

         
            <div class="cate_shop">
                <h2>Brand News 品牌动向</h2>
                <div className="every_shop">
                   {
                       cate_shop.map((v,i)=>{
                           return(
                               <div onClick={()=>this.tap()} key={i}>
                                  <p>{v.name}</p>
                                  <img src={v.url}/>
                               </div>
                           )
                       })
                   }
                </div>
            </div> 
             <Pagination current={this.state.current}  pageSize={24} onChange={this.onChange} total={36} defaultCurrent={1}/>;
            </div>
        )
    }
    
}